/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.cput.tp.patterns.behaviour.mediatorpattern;

/**
 *
 * @author Malotana
 */
public class Mediator {
    Buyer swedishBuyer;
    Buyer frenchBuyer;
    AmericanSeller americanSeller = null;
    DollarConveter dollarConverter;

    
    public void registerAmericanSeller(AmericanSeller americanSeller) {
        this.americanSeller = americanSeller;
    }

   
    public void registerDollarConverter(DollarConveter dollarConverter) {
        this.dollarConverter = dollarConverter;
    }

    public void registerFrenchbuyer(FrenchBuyer frenchBuyer) {
        this.frenchBuyer = frenchBuyer;
    }


    public void registerSwedishBuyer(SwedishBuyer swedishBuyer) {
        this.swedishBuyer = swedishBuyer;
    }
    
    public boolean placeBid(float bid,String unitOfcurrency){
        float dollaramount = dollarConverter.convertCurrencyToDollars(bid, unitOfcurrency);
        return americanSeller.isBidAccepted(dollaramount); 
    }
}
